using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Configuration;
using log4net;
using System.IO;

namespace Common.Logging
{
    internal class DefaultLogger : ILogger
    {
        static ILog log;

        static DefaultLogger()
        {
            log = LogManager.GetLogger("logger");
            Log4netConfigurator.Config();
        }

        string GetMessage(string msg)
        {
            return msg;
        }

        public virtual void Debug(string message)
        {
            log.Debug(GetMessage(message));
        }

        public virtual void Debug(string message, Exception ex)
        {
            log.Debug(GetMessage(message), ex);
        }

        public virtual void Info(string message)
        {
            log.Info(GetMessage(message));
        }

        public virtual void Info(string message, Exception ex)
        {
            log.Info(GetMessage(message), ex);
        }

        public virtual void Warn(string message)
        {
            log.Warn(GetMessage(message));
        }

        public virtual void Warn(string message, Exception ex)
        {
            log.Warn(GetMessage(message), ex);
        }

        public virtual void Error(string message)
        {
            log.Error(GetMessage(message));
        }

        public virtual void Error(string message, Exception ex)
        {
            log.Error(GetMessage(message), ex);
        }

        public virtual void Fatal(string message)
        {
            log.Fatal(GetMessage(message));
        }

        public virtual void Fatal(string message, Exception ex)
        {
            log.Fatal(GetMessage(message), ex);
        }
    }
}
